import React from 'react';
import AxDealFlow from '@/pages/buyer/person/flow/deal/index';
import { flowTypes } from '@/pages/buyer/person/flow/type/index';
import { Transfer } from '@/pages/buyer/person/flow/deal/lib/transfer';
import { EduStatus } from '@/pages/buyer/person/flow/deal/lib/eduStatus';
import { NameAndIdcard } from '@/pages/buyer/person/flow/deal/lib/nameAndIdcard';
import { axurl } from '@/shared/axurl';

const Index: React.FC<any> = props => {
    const { location } = props;
    const { id, type: typeFromQuery } = location && location.query && location.query || {};
    let type = parseInt(typeFromQuery);
    let ComponentType: any = () => <></>;
    const flowType: any = flowTypes.find((f: any) => f.type == type) || {};
    switch (type) {
        case 1:   //转专业
            ComponentType = Transfer;
            break;
        case 3:   //修改在校状态
            ComponentType = EduStatus;
            break;
        case 4:   //修改姓名身份证
            ComponentType = NameAndIdcard;
            break;
    }

    return (
        <AxDealFlow
            title={flowType.dealTitle}
            tabs={flowType.tabs}
            url={axurl.center.s.flow.need}
            FlowComponent={ComponentType}
            recordId={id}
            operateType={true}
        // flowProps={{
        //     studentStatusId: studentStatusId,
        // }}
        // extraParams={{
        //     studentId: studentStatusId,
        // }}
        />
    )
};
export default Index;                                   